import request from '@/utils/request'

// 查询字典类型列表
export function listDictType(query) {
  return request({
    url: '/system/dict/type/list',
    method: 'get',
    params: query
  })
}

// 新增字典类型
export function addDictType(data) {
  return request({
    url: '/system/dict/type/add',
    method: 'post',
    data: data
  })
}

// 修改字典类型
export function updateDictType(data) {
  return request({
    url: '/system/dict/type/update',
    method: 'put',
    data: data
  })
}

// 导出字典类型
export function exportDictType(query) {
  return request({
    url: '/system/dict/type/export',
    method: 'get',
    params: query
  })
}

// 删除字典类型
export function deleteDictType(dictIds) {
  return request({
    url: '/system/dict/type/delete/' + dictIds,
    method: 'delete'
  })
}

// 查询字典数据列表
export function listDictData(query) {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params: query
  })
}

// 新增字典数据
export function addDictData(data) {
  return request({
    url: '/system/dict/data/add',
    method: 'post',
    data: data
  })
}

// 修改字典数据
export function updateDictData(data) {
  return request({
    url: '/system/dict/data/update',
    method: 'put',
    data: data
  })
}

// 导出字典数据
export function exportDictData(query) {
  return request({
    url: '/system/dict/data/export',
    method: 'get',
    params: query
  })
}

// 删除字典数据
export function deleteDictData(dictCode) {
  return request({
    url: '/system/dict/data/delete/' + dictCode,
    method: 'delete'
  })
}

// 根据字典类型查询字典数据信息
export function getDictDataByType(dictType) {
  return request({
    url: '/system/dict/data/listByType/' + dictType,
    method: 'get'
  })
}

// 查询第三方数据列表
export function listThirdData(query) {
  return request({
    url: '/system/dict/thirdData/list',
    method: 'get',
    params: query
  })
}

// 查询第三方数据列表
export function exportThirdData(query) {
  return request({
    url: '/system/dict/thirdData/export',
    method: 'get',
    params: query
  })
}

// 新增第三方数据
export function addThirdData(data) {
  return request({
    url: '/system/dict/thirdData/add',
    method: 'post',
    data: data
  })
}

// 修改第三方数据
export function updateThirdData(data) {
  return request({
    url: '/system/dict/thirdData/update',
    method: 'put',
    data: data
  })
}

// 删除第三方数据
export function delThirdData(id) {
  return request({
    url: '/system/dict/thirdData/delete',
    method: 'delete',
    params: id
  })
}
